package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.AlertDataDto;
import com.zzyl.dto.AlertDataHandleDto;
import com.zzyl.service.impl.AlertDataServiceImpl;
import com.zzyl.vo.AlertDataVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/alert-data")
@Api(tags = "6.1 分页查询报警数据")
public class AlertDataController {

    @Autowired
    private AlertDataServiceImpl alertDataService;
    @GetMapping("/pageQuery")
    public ResponseResult<PageResponse<AlertDataVo>>pageQuery(AlertDataDto dto){
        PageResponse<AlertDataVo> vo = alertDataService.pageQuery(dto);
        return ResponseResult.success(vo);

    }
    @PutMapping("/handleAlertData/{id}")
    private ResponseResult handleAlertData(@PathVariable("id") Long id, @RequestBody AlertDataHandleDto dto){

        alertDataService.handleAlertData(id, dto);
        return ResponseResult.success();
    }



}
